package cn.detu.ln.config;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
// 配置分页拦截器
public class PageConfiguration {
   @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
       // 1.实例化分页拦截对象
       MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
       // 2.添加拦截类型
       mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
       return mybatisPlusInterceptor;
   }
}
